define(function(require,exports,module){
    
    require('common');
    require('/plugins/echarts/echarts-plain-original');
    
    
    var tpl = require('../../tpl/member/recharge_log.tpl');//载入tpl模板
    var curId = $("#rechargeDiv");
    var pagerid = "kkpagerRecharge";
    //初始化显示表格、搜索
    require.async(['./showTable','./search'],function(showTable,search){
        showTable.ajaxUrl('/member/recharge/logList.html?',tpl,curId,pagerid);
        search.search('/member/recharge/logList.html?',tpl,curId,pagerid);
        
        // 点击后重新加载列表分页搜索
        $(".recharge_record").click(function(){
        	showTable.ajaxUrl('/member/recharge/logList.html?',tpl,curId,pagerid);
        });
    });
    
    
    $(".rechargeCash").tabChange({
		isClick:true,
		isHover:false,
		childLi:".title_list li",//tab选项卡
		childContent:".list_div",//tab内容
		hoverClassName:"hover",//选中当前选项卡的样式
		callBack:false	
	});
    //sqdChart();
    function sqdChart(){
		$.ajax({
			url:"/invest/sinaApr.html",
			type:"get",
			dataType:"json",
			success:function(data) {
				var myChart = echarts.init(document.getElementById('sqdProfitChart'));
				var option = {
					tooltip: {
						trigger: 'axis',
						axisPointer: {            // 坐标轴指示器，坐标轴触发有效
							type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
						}
					},
					legend: {
						data: []
					},
					toolbox: {
						show: true,
						orient: 'vertical',
						x: 'right',
						y: 'center',
						feature: {
							mark: false,
							dataView: {readOnly: false},
							magicType: ['line', 'bar'],
							restore: false,
							saveAsImage: false
						}
					},
					calculable: false,
					xAxis: [
						{
							type: 'category',
							data: data.day
						}
					],

					yAxis: [
						{
							type: 'value',
							splitArea: {show: false},
							axisLabel: {
								formatter: '{value}%'
							}
						}
					],

					series: [
						{
							name: '今日利率',
							type: 'line',
							stack: '待收',
							itemStyle: {
								normal: {
									lineStyle: {
										color: '#f77474'
									}
								}
							},
							data: data.apr
						}
					]
				};
				// 为echarts对象加载数据
				myChart.setOption(option);
				$("#apr").html(data.yApr);
			}
			});
    }
});